package com.yupi.springbootinit.service.execution;

import com.yupi.springbootinit.common.ErrorCode;
import com.yupi.springbootinit.exception.BusinessException;
import com.yupi.springbootinit.model.entity.Chart;
import com.yupi.springbootinit.model.vo.BiResponse;
import com.yupi.springbootinit.service.GenChartStrategy;
import org.springframework.stereotype.Component;

/**
 * 拒绝策略
 * @TODO 反向压力
 */
@Component(value = "gen_reject")
public class GenChartReject implements GenChartStrategy {

    @Override
    public BiResponse executeGenChart(Chart chartEntity) {
        throw new BusinessException(ErrorCode.TOO_MANY_REQUEST, "服务器繁忙,请稍后重试!");
    }
}